/* -----------------------------------------------------------
 * Author: Marie Caswell
 * Testing Function: salvager card

 * Description: Checks for the value of numBuys and coins 
 * after salvager is played
 -----------------------------------------------------------*/

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"

int main(){

int seed = 1000;
int numPlayer = 2;
struct gameState G;
int null=0;
int currentCoins = 10;
int k[10] = {adventurer, gardens, salvager, village, minion, mine, cutpurse, sea_hag, estate, smithy};
memset(&G, 23, sizeof(struct gameState));   // clear the game state
initializeGame(numPlayer, k, seed, &G); // initialize a new game 

G.whoseTurn = 0;
G.coins = currentCoins;

printf("pre-salvager coins: %d\n", G.coins);
printf("pre-salvager buys: %d\n", G.numBuys);

gainCard(salvager, &G, 2, 0); //place salvager in first player's hand
 
cardEffect(salvager, minion, null, null, &G, 0, &null); //play salvager, trash minion

printf("post-salvager coins: %d\n", G.coins);
printf("post-salvager buys: %d\n", G.numBuys);

assert(G.numBuys == 2); //confirm player buys increased by 1

assert(G.coins == 15); //minion worth five -- assertion should be correct.  
//unsure if issue is bug in dominion code or bug in testing code

printf("\nTests passed.\n\n");

return 0;

 }